<?php

namespace app\controllers;

use Yii;

class SiteController extends BaseController
{

    /**
     * 错误处理页面
     * @return array 配置数组
     */
    public function actions()
    {
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ]
        ];
    }

    /**
     * 显示主页
     *
     * @return string 页面渲染结果
     */
    public function actionIndex()
    {
        // Yii::$app->response->format= yii\web\Response::FORMAT_JSON;
        // return $this->render('index');
        return ['code'=>1];
    }
}
